
export const apiGroup = {
    // 获取分组跟节点
    getApiGroupRoot: param => {
        return $http.post(`${window.RPConfig.mgt}/api/getApiGroupRoot`, param, null, { params: param }).then(response => response.data);
    },
    // 根据父节点id获取分组子节点
    getApiGroupByParentId: param => {
        return $http.post(`${window.RPConfig.mgt}/api/getApiGroupByParentId`, param, null, { params: param }).then(response => response.data);
    },
    // 根据分组路径获取api
    getApiByGroupPath: ({ responseProcess, param }) => {
        $http.post(`${window.RPConfig.mgt}/api/getApiByGroupPath`, param).then(res => {
            responseProcess(res.data);
        });
    },
    // 添加分组子节点
    addGroup: param => {
        return $http.post(`${window.RPConfig.mgt}/api/addGroup`, param).then(response => response.data);
    },
    // 根据id删除分组
    deleteApiGroupById: param => {
        return $http.post(`${window.RPConfig.mgt}/api/deleteApiGroupById`, param, null, { params: param }).then(response => response.data);
    },
    // 添加api
    addApi: param => {
        return $http.post(`${window.RPConfig.mgt}/api/addApi`, param).then(response => response.data);
    },
    // 添加api
    batchAddApi: param => {
        return $http.post(`${window.RPConfig.mgt}/api/batchAddApi`, param).then(response => response.data);
    },
    // 修改api
    editApi: param => {
        return $http.post(`${window.RPConfig.mgt}/api/updateApi`, param).then(response => response.data);
    },
    // 批量删除api
    deleteApiByIds: param => {
        return $http.post(`${window.RPConfig.mgt}/api/deleteApiByIds`, param, null, { params: param }).then(response => response.data);
    },
    // 获取服务地址
    getServiceAddress: param => {
        return $http.post(`${window.RPConfig.mgt}/api/getServiceAddress`, param, null, { params: param }).then(response => response.data);
    },
}
// 获取swagger接口列表
export const getSwaggerList = param => {
    return $http.post(`${window.RPConfig.mgt}/api/getSwaggerList`, param).then(response => response.data);
};

// 查询历史记录列表
export const getApiHistoryList = param => {
    return $http.post(`${window.RPConfig.mgt}/api/apiHistoryList`, param).then(response => response.data);
};
// api历史记录详情
export const getHistoryDetail = param => {
    return $http.post(`${window.RPConfig.mgt}/api/apiHistoryDetail`, param).then(response => response.data);
};